file: GameSave API


list: Enabling GameSave Feature

Maps can be supported with GameSave feature by
assigning their gamesave group index.

To disable it, simply unassign its gamesave group index.

(see csoluaGameSave01.png)


list: GameSave Data

There are 2 types of gamesave data:

    1. - Shared gamesave data, and
    2. - Player gamesave data.

Shared gamesave data will be shared to all maps
on same savegame group index.

For example, map "A" and map "B" are assigned to savegame group index "1".
Then, the scripter saves data with <Game.Rule.SetGameSave> on map "A".
After that, that saved data is shared to both maps and can be retrieved with <Game.Rule.GetGameSave>.

Meanwhile in player gamesave data, is saved on specific player,
shared to all maps on same savegame group index.

For example, map "A" and map "B" are assigned to savegame group index "1".
Then, player "Bob" plays map "A" and saves data with <Game.Player.SetGameSave>.
After exit from map "A", player "Bob" plays map "B".
Then, that saved data is shared to both maps
and can be retrieved with <Game.Player.GetGameSave> for player "Bob".


list: Save & Load

Shared gamesave data is automatically loaded at the start of the game
and bulk-saved automatically each 1 minute
or at the end of the game.

Player gamesave data can be loaded automatically
or manually by pressing "L" after spawn for first time
depends on <Common.SetAutoLoad> setting.

If the player does not load the data,
it will be automatically saved each 1 minute or at the end of the game
and overwritten with the new data!


list: Common Player GameSave Data

Player data automatically saves and loads some common data.

Below is the list of them:

    "health"    - Current HP.
    "maxhealth" - Maximum HP.
    "armor"     - Current AP.
    "maxarmor"  - Maximum AP.
    "coin"      - Studio coin amount(s).
    "items"     - Studio item inventory list.

Because the above data are saved automatically, the scripter
can't overwrite them with <Game.Player.SetGameSave> method.
However, you can retrieve them with <Game.Player.GetGameSave> method.

